{__NOLAYOUT__}

<Widget:show bdcls="no-padding" title="列表" col="12">
<div class="row imglist" >
    <p>数据加载中。。。</p>
</div>
<div class="hide frist"></div>
<div class="hide next"></div>
<div class="hide prep"></div>
</Widget:show>


<script id="img" type="text/html">
<%for(i = 0; i < data.length; i ++) {%>
<div class="col-sm-2 col-md-2">
    <a href="#" style="height: 120px;"  onclick="selectFiled('<%=data[i].url%>','<%=data[i].id%>','<%=data[i].name%>')"  class="thumbnail">
        <img style="height: 120px;" src="<%=data[i].url%>" />
    </a>
</div>
<%}%>
</script>
<script type="text/javascript">
$(function(){
    var p = 1;
    $('.next').on('click',function(){
        p++;
        getList(p);
    })

    $('.prep').on('click',function(){
        p--;
        getList(p);
    })

    $('.frist').on('click',function(){
        getList(1);
    })

    getList(1);

    function getList(page) {
        if (!page) page = 1;
        var url = "{:U('FileManger/index')}";
        $.post(url,{curPage:page,pageSize:12},function(req){
            var html = template('img', req);
            $('.imglist').html(html);
        })
    }

})
</script>
